package com.ceair.flight.refund.service.cronjob.impl;

import com.ceair.flight.refund.service.cronjob.CronJobTask;
import com.ceair.flight.refund.service.cronjob.IScheduleService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.ws.rs.Path;

@Service("cronJobTaskImpl")
@Path("/")
public class CronJobTaskImpl implements CronJobTask {

    private static final Logger LOG = LoggerFactory.getLogger(CronJobTaskImpl.class);
    @Resource(name = "autoGenRefNoExcServiceImpl")
    private IScheduleService autoGenRefNoService;
    @Resource(name = "autoFirstAuditServiceImpl")
    private IScheduleService autoFirstAuditService;
    @Resource(name = "autoSecondAuditServiceImpl")
    private IScheduleService autoSecondAuditService;

    @Override
    @Path("/autoGenRefNo")
    public void autoGenRefNo() {
        LOG.info("External invoke auto generate refund ticket No service begining");
        autoGenRefNoService.doScheduleTask();
        LOG.info("External invoke auto generate refund ticket No service finised");
    }

    @Override
    @Path("/autoFirstAudit")
    public void autoFirstAudit() {
        LOG.info("External invoke auto first audit service begining");
        autoFirstAuditService.doScheduleTask();
        LOG.info("External invoke auto first audit service finised");
    }

    @Override
    @Path("/autoSecondAudit")
    public void autoSecondAudit() {
        LOG.info("External invoke auto second audit service begining");
        autoSecondAuditService.doScheduleTask();
        LOG.info("External invoke auto second audit service finised");
    }

}
